-
Notifications
You must be signed in to change notification settings - Fork 7
New telemetry values #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Ross Grambo <rossgrambo@microsoft.com>
| allocation_percentage = 0 | ||
| for allocation in evaluation_event.feature.allocation.percentile: | ||
| if ( | ||
| evaluation_event.variant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to check whether evaluation_event.variant is None in advance so that we can shortcircuit before the for loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a possible case that variantAssignmentReason is not None but variant is None? I cannot imagine it will happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhiyuanliang-ms, I've made some changes already to this in my already existing PR that has some updates. #45
|
|
||
| # DefaultWhenEnabled | ||
| if evaluation_event.feature.allocation and evaluation_event.feature.allocation.default_when_enabled: | ||
| event["DefaultWhenEnabled"] = evaluation_event.feature.allocation.default_when_enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to call out that it is possible that variant assignment reason is defaultWhenEnabled but the assigned variant is empty/none. The reason of this design is that if we have empty allocation configuration, (in .NET) we can consider it as:
{
"allocation": {
"default_when_enabled" : ""
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't whether it is a better choice to have event["DefaultWhenEnabled"] = "" when there is no allocation.default_when_enabled. But it could be another option for us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| event["VariantAssignmentPercentage"] = str(100 - allocation_percentage) | ||
| elif evaluation_event.reason == VariantAssignmentReason.PERCENTILE: | ||
| if evaluation_event.feature.allocation and evaluation_event.feature.allocation.percentile: | ||
| allocation_percentage = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this line before the above if statement to make it consistent with line 70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my latest PR. I already made these changes.
| for allocation in evaluation_event.feature.allocation.percentile: | ||
| if ( | ||
| evaluation_event.variant | ||
| and allocation.variant == evaluation_event.variant.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rossgrambo @mrm9084 Can you confirm whether this line is by design please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect- it's updated in https://github.com/microsoft/FeatureManagement-Python/pull/45/files#diff-e599fecd01f487185b6b19104e39d7a20d310657896ddeee742af944b129945a
Description
Adds VariantAllocationPercentage, DefaultWhenEnabled, and AllocationId to telemetry.
Contribution checklist:
General Guidelines and Best Practices